# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-expect
_pkgname=Expect
pkgver=1.35
pkgrel=11
pkgdesc='This module is a successor of Comm.pl and a descendent of Chat.pl. It more closely ressembles the Tcl Expect language than its predecessors.'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-io-tty>=1.03')
makedepends=('perl-module-install')
url='http://search.cpan.org/dist/Expect'
source=("http://search.cpan.org/CPAN/authors/id/J/JA/JACOBY/$_pkgname-$pkgver.tar.gz")
sha512sums=('97ff1969323cf0bcdecc792199111e273e1a4c032a9cdecac1acb521a280e772256c1a8c5433b4da1f34a585d83608522e9f00cf3c5a0a30211662a5373ef0b7')

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd "$_pkgname-$pkgver"

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

